import 'normalize.css'
import './assets/main.css'
import 'vant/lib/index.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import { registerStore } from '@/store'

import App from './App.vue'
import router from './router'
import directives from '@/utils/directive'

const app = createApp(App)
for (const key in directives) {
  if (Object.prototype.hasOwnProperty.call(directives, key)) {
    app.directive(key, directives[key])
  }
}

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

app.use(pinia)
registerStore()
app.use(router)

app.mount('#app')
